Skip to content

chore: Update starter example#2268

Merged
josephfusco merged 10 commits intocanaryfrom
update-starter-example
Feb 23, 2026
Merged

chore: Update starter example#2268
josephfusco merged 10 commits intocanaryfrom
update-starter-example

Conversation

@ahuseyn
Copy link
Copy Markdown
Member

@ahuseyn ahuseyn commented Feb 18, 2026

Upgrades the faustwp-getting-started example from Next.js 14 to 16 and addresses breaking changes.

Changes

  • Next.js 16 upgrade — Update to next@^16.1.6, replace deprecated images.domains with remotePatterns, and adjust sassOptions
  • Refactor GraphQL queries — Extract a shared GET_LAYOUT_QUERY fragment and update all templates to use multiple queries with default variable values
  • Fix CI for Turbopack — Add --webpack flag to bundle analysis build (required by @next/bundle-analyzer), pin @wordpress/block-library to exact 9.10.0 to prevent SCSS import failures in lockfile-free E2E runs, and drop Node 18 from the E2E matrix to match engines >=20.9

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 18, 2026

⚠️ No Changeset found

Latest commit: 051c1f6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 18, 2026

📦 Next.js Bundle Analysis for @faustwp/getting-started-example

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 245.12 KB (🟡 +11.93 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Two Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/example 10.23 KB 255.35 KB 72.96% (🟢 -8.02%)
/preview 259 B 245.38 KB 70.11% (+/- <0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@josephfusco josephfusco self-assigned this Feb 23, 2026
Pin @wordpress/block-library to exact 9.10.0 to prevent SCSS import
breakage in E2E tests, add --webpack flag to bundle analysis build
for Turbopack compatibility, and drop Node 18 from E2E matrix to
match engines requirement.
@josephfusco josephfusco changed the title chore: Update starter example Migrate faustwp-getting-started to Next.js 16 Feb 23, 2026
@josephfusco josephfusco changed the title Migrate faustwp-getting-started to Next.js 16 chore: Update starter example Feb 23, 2026
@josephfusco josephfusco marked this pull request as ready for review February 23, 2026 14:09
@josephfusco josephfusco requested a review from a team as a code owner February 23, 2026 14:09
@josephfusco josephfusco force-pushed the update-starter-example branch from f37406f to d0c8eb9 Compare February 23, 2026 14:42
The :global(.component *) block in ContentWrapper.module.scss targeted
the literal un-mangled class .component, while ContentWrapper.js applies
the mangled CSS module class — so these styles never matched. The block
styles already work via global.scss importing _blocks.scss. Simply
removing the dead :global block fixes the Next.js 16 purity error
without needing any webpack overrides.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the faustwp-getting-started example from Next.js 14 to Next.js 16, addressing breaking changes and refactoring GraphQL query patterns to improve maintainability.

Changes:

  • Upgraded to Next.js 16.1.6 with corresponding dependency updates
  • Refactored GraphQL queries to use a shared GET_LAYOUT_QUERY fragment and multiple queries per template
  • Updated Next.js configuration for v16 compatibility (remotePatterns, sassOptions)
  • Fixed CI/CD workflows to support Turbopack requirements and updated Node version matrix

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
package.json Upgraded Next.js to 16.1.6, pinned @wordpress/block-library to 9.10.0, updated engines to require Node >=20.9
next.config.js Replaced deprecated images.domains with remotePatterns, updated sassOptions includePaths
fragments/LayoutQuery.js New shared GraphQL query fragment for layout data (general settings, menus)
wp-templates/tag.js Refactored to use useFaustQuery with Component.queries array pattern
wp-templates/single.js Refactored to use multiple queries with shared layout query
wp-templates/page.js Refactored to use useFaustQuery with Component.queries array pattern
wp-templates/index.js Changed front-page to static import, added ssr: false to other dynamic imports
wp-templates/front-page.js Refactored to use shared layout query and useFaustQuery
wp-templates/category.js Refactored to use useFaustQuery with Component.queries array pattern
components/NavigationMenu/*.scss Updated SCSS import paths from 'styles/' to '../../styles/'
components/Hero/Hero.module.scss Updated SCSS import paths from 'styles/' to '../../styles/'
components/Header/Header.module.scss Updated SCSS import paths from 'styles/' to '../../styles/'
components/EntryHeader/EntryHeader.module.scss Updated SCSS import paths from 'styles/' to '../../styles/'
components/ContentWrapper/ContentWrapper.module.scss Removed inline WordPress block styles (now imported globally)
.github/workflows/nextjs-bundle-analysis.yml Updated Node version to 20, added --webpack flag to build command
.github/workflows/e2e-next-faustwp-example.yml Removed Node 18 from test matrix
Comments suppressed due to low confidence (5)

examples/next/faustwp-getting-started/next.config.js:16

  • The remotePatterns configuration is missing the protocol property. According to Next.js documentation, remotePatterns should include a protocol field. For most WordPress installations, this should be 'https'. The configuration should look like: { protocol: 'https', hostname: getWpHostname() }
    remotePatterns: [
      {
        hostname: getWpHostname(),
      },

examples/next/faustwp-getting-started/wp-templates/tag.js:46

  • Missing nullish coalescing operator on useFaustQuery(GET_LAYOUT_QUERY). This is inconsistent with the same pattern used in single.js, page.js, and front-page.js, where the result is protected with ?? {}. Without this guard, the destructuring on line 45-46 could fail if the query returns undefined.
	const { generalSettings, headerMenuItems, footerMenuItems } =
		useFaustQuery(GET_LAYOUT_QUERY);

examples/next/faustwp-getting-started/wp-templates/category.js:46

  • Missing nullish coalescing operator on useFaustQuery(GET_LAYOUT_QUERY). This is inconsistent with the same pattern used in single.js, page.js, and front-page.js, where the result is protected with ?? {}. Without this guard, the destructuring on line 45-46 could fail if the query returns undefined.
	const { generalSettings, headerMenuItems, footerMenuItems } =
		useFaustQuery(GET_LAYOUT_QUERY);

examples/next/faustwp-getting-started/wp-templates/tag.js:75

  • Missing key prop on Post component within map function. React requires a unique key prop for each element in a list. The query returns id field (line 25) which should be used as the key: key={post.node.id}
							<Post
								title={post.node.title}
								content={post.node.content}
								date={post.node.date}
								author={post.node.author?.node.name}
								uri={post.node.uri}
								featuredImage={post.node.featuredImage?.node}
							/>

examples/next/faustwp-getting-started/wp-templates/category.js:75

  • Missing key prop on Post component within map function. React requires a unique key prop for each element in a list. The query returns id field (line 25) which should be used as the key: key={post.node.id}
							<Post
								title={post.node.title}
								content={post.node.content}
								date={post.node.date}
								author={post.node.author?.node.name}
								uri={post.node.uri}
								featuredImage={post.node.featuredImage?.node}
							/>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@josephfusco josephfusco merged commit 77552f7 into canary Feb 23, 2026
22 checks passed
@josephfusco josephfusco deleted the update-starter-example branch February 23, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants